<?php
defined('IN_SITE') or exit('Access Denied');
get_header();
?>
<body>
<form name="myform" method="post" action="?module=<?=$module?>&action=listorder">
<table align="center" cellpadding="0" cellspacing="1" class="table_list">
    <caption><?=$parentid && $parentname ? '['.$parentname.'] 子' : ''?>菜单管理</caption>
<tr>
<th width="6%">排序</th>
<th width="5%">ID</th>
<th width="33%">名称</th>
<th width="13%">打开窗口</th>
<th width="8%">类型</th>
<th width="35%">管理操作</th>
</tr>
<?php
	foreach($infos as $id=>$menu)
	{
?>
<tr>
<td><input type="text" name="listorder[<?=$menu['menuid']?>]" value="<?=$menu['listorder']?>" size="5"></td>
<td><?=$menu['menuid']?></td>
<td><a href="?module=<?=$module?>&action=manage&parentid=<?=$menu['menuid']?>&parentname=<?=urlencode($menu['name'])?>"><?=$menu['name']?></a></td>
<td><?=$TARGET[$menu['target']]?></td>
<td><?=$menu['isfolder'] ? '目录' : '链接'?></td>
<td>
<a href="?module=<?=$module?>&action=add&parentid=<?=$menu['menuid']?>&parentname=<?=urlencode($menu['name'])?>">添加子菜单</a> |
<?php if($menu['isfolder']){ ?><a href="?module=<?=$module?>&action=manage&parentid=<?=$menu['menuid']?>&parentname=<?=urlencode($menu['name'])?>">子菜单</a> <?php }else{ ?><font color="#cccccc">子菜单</font><?php } ?> |
<a href="?module=<?=$module?>&action=edit&menuid=<?=$menu['menuid']?>">修改</a> |
<a href="?module=<?=$module?>&action=disable&menuid=<?=$menu['menuid']?>&disabled=<?=($menu['disabled']==1 ? 0 : 1)?>"><?=($menu['disabled']==1 ? '<font color="red">启用</font>' : '禁用')?></a> | 
<a href="javascript:confirmurl('?module=<?=$module?>&action=delete&menuid=<?=$menu['menuid']?>&forward='+escape('<?=$forward?>'), '确认删除菜单“<?=$menu['name']?>”吗')">删除</a>
</td>
</tr>
<?php
	}
?>
</table>

<div>
	 <input name="dosubmit" type="submit" value=" 排序 " /> 
	 <input name="addmenu" type="button" value="添加菜单" onClick="redirect('?module=menu&action=add&parentid=<?=$parentid?>&parentname=<?=urlencode($parentname)?>')" />
</div>
<div class="pages">
	<?=$m->pages?>
</div>

</form>

</body>
</html>